package FP;

public class LambdaDemo {
    public static void main(String[] args) {
        int x = 10, y = 5;
        System.out.println("x=" + x + ", y=" + y);
        MathOperation addition = (int a, int b) -> a + b;
        System.out.println("x+y=" + addition.operation(x, y));
        MathOperation subtraction = (a, b) -> a - b;
        System.out.println("x-y=" + subtraction.operation(x, y));
        MathOperation multiplication = (int a, int b) -> {
            return a * b;
        };
        System.out.println("x*y=" + multiplication.operation(x, y));
        Manner greeting = msg -> System.out.println(msg);
        greeting.say("hello");
    }

    public interface MathOperation {
        int operation(int a, int b);
    }

    public interface Manner {
        void say(String msg);
    }
}
